<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="打开" onclick="b();">
<script>
    console.log(history.length);
    var i =1;
    function b() {
        console.log(i);
        i ++;
        console.log(i);
        window.open('http://www.baidu.com', '曹尼玛', 'location=yes,scrollbars=no,width=500,height=400,status=no,top=500,left=500');
    }
</script>
</body>
</html>